<?php
namespace Common\Model;
use Think\Model;

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
class PositionModel extends Model{
    private $_db='';
    public function __construct(){
        $this->_db=M("Position");
    }
    public function select($data=array()){
        $conditions=$data;
        $list=$this->_db->where($conditions)->order('id')->select();
        return $list;
    }
    
    public function find($id){
      $data=$this->_db->where('id='.$id)->find();  
       return $data;
    }
    public function updateById($id,$data){
        if(!$id ||!is_numeric($id)){
            throw_exception("ID不合法");
        }
        if(!$data ||!is_array($data)){
            throw_exception("数据不合法");
        }
    }
    
    public function getNormalPositions(){
        $conditions=array('status'=>1);
        $list=$this->_db->where($conditions)->order('id')->select();
        return $list;
    }
   //
   
    
    
}
